﻿IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'GetEmpleadosByDNI')
	BEGIN
		DROP  Procedure  GetEmpleadosByDNI
	END

GO

CREATE Procedure GetEmpleadosByDNI

	(
		@dni VarChar(8) 
	)

AS

BEGIN
	SET NOCOUNT ON
	
	SELECT
	[Apellidos],
	[Direccion],
	[DNI],
	[Email],
	[IdCargo],
	[IdEmpleado],
	[Nombre],
	[Telefono]
	FROM [Empleados] 
	WHERE [DNI] LIKE (@dni + '%')

	SET NOCOUNT OFF
END

GO


GRANT EXEC ON GetEmpleadosByDNI TO PUBLIC

GO


